<?php
namespace app\index\model;
class Types extends BaseModel{
    
    
    function getTypes(){
        $type = D('type');
        return $type->select();
    }
    function getTypes2(){
        $type = D('type');
        $r1=$type->where("type",1)->find();
        $r2=$type->where("type",2)->find();
        $r3=$type->where("type",3)->find();
        $r9=$type->where("type",9)->find();
        $data = [];
        $r1['peilv'] = round($r1['peilv']/100,2);
        $r2['peilv'] = round($r2['peilv']/100,2);
        $r3['peilv'] = round($r3['peilv']/100,2);
        $r9['peilv'] = round($r9['peilv']/100,2);
        $data[0] = $r1;
        $data[1] = $r2;
        $data[2] = $r3;
        $data[3] = $r9;
        return $data;
    }
    function getType($types){
        $type = D('type');
        return $type->where("type",$types)->find();
    }
    
    function get_min_and_max(){
        $sys = D('sysconfig');
        return $sys->find();
    }
    
}
